package com.mysafe.provision.model.cycletype;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(schema = "sfe", name = "en_cycle_type")
public class CycleType implements Serializable, Comparable<CycleType> {
	
	private static final long serialVersionUID = -3393747079708649604L;

	public static final Integer FIXED = 1;
	public static final Integer VARIED = 2;

	@Id
	@Column(name = "id_cycle_type")
	private Integer id;
	private String name;

	public CycleType() {
	}

	public CycleType(Integer id) {
		this.id = id;
	}
	
	public CycleType(Integer id, String name) {
		this.id = id;
		this.name = name;
	}

	@Override
	public int compareTo(CycleType o) {
		return this.name.compareToIgnoreCase(o.getName());
	}
	
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
}